//
//  SingleActionNetWork.m
//  Shengzhuli
//
//  Created by 卡忙科技 on 16/8/24.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "SingleActionNetWork.h"
#import "GFXNetworkHandle.h"

NSString * const UserSureReceive = @"auth/order/buy/receipt";//普通用户确认收货
NSString * const UserBackApply = @"auth/order/buy/send/returned/apply";//普通用户退货申请
NSString * const UserReturnNormal = @"auth/order/buy/returned/delivery";//商家同意退货普通用户发货
NSString * const UserCancelSingle = @"auth/order/buy/cancel";//用户取消订单
NSString * const SellerSendGoods = @"auth/order/buy/delivery";//商家发货
NSString * const SellerAgreeRefuse = @"auth/order/buy/returned/agree/apply/or/refuse";//商家同意拒绝退货
NSString * const SureReceiveReturn = @"auth/order/buy/returned/shop/receipt";//商家确认收到买家退货
NSString * const SellerReturnMoney = @"auth/order/buy/returned/shop/play/money";//商家打款

@implementation SingleActionNetWork


+ (void)userSureWithParame:(NSDictionary *)parames response:(void (^)(BOOL success,NSString *msg))response
{
    [[GFXNetworkHandle shareHandle]post:UserSureReceive params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"]);
        }else{
            response(NO,json[@"message"]);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError);
    }];
}

+ (void)userBackApplyWithParame:(NSDictionary *)parames response:(void (^)(BOOL success,NSString *msg))response
{
    [[GFXNetworkHandle shareHandle]post:UserBackApply params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"]);
        }else{
            response(NO,json[@"message"]);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError);
    }];
}

+ (void)userSendBackWithParame:(NSDictionary *)parames response:(void (^)(BOOL success,NSString *msg))response
{
    [[GFXNetworkHandle shareHandle]post:UserReturnNormal params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"]);
        }else{
            response(NO,json[@"message"]);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError);
    }];
}
+ (void)userCancelSingleWithParame:(NSDictionary *)parames response:(void (^)(BOOL success,NSString *msg))response
{
    [[GFXNetworkHandle shareHandle]post:UserCancelSingle params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"]);
        }else{
            response(NO,json[@"message"]);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError);
    }];
}

+ (void)sellerSendGoodsWithParame:(NSDictionary *)parames response:(void (^)(BOOL success,NSString *msg))response
{
    [[GFXNetworkHandle shareHandle]post:SellerSendGoods params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"]);
        }else{
            response(NO,json[@"message"]);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError);
    }];
}

+ (void)sellerAgreeRefuseWithParame:(NSDictionary *)parames success:(void (^)(BOOL success,NSString *msg))response
{
    [[GFXNetworkHandle shareHandle]post:SellerAgreeRefuse params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"]);
        }else{
            response(NO,json[@"message"]);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError);
    }];
}

+ (void)sellerSureReturnParame:(NSDictionary *)parames success:(void (^)(BOOL success,NSString *msg))response
{
    [[GFXNetworkHandle shareHandle]post:SureReceiveReturn params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"]);
        }else{
            response(NO,json[@"message"]);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError);
    }];
}

+ (void)sellerReturnMoneyParame:(NSDictionary *)parames success:(void (^)(BOOL success,NSString *msg))response
{
    [[GFXNetworkHandle shareHandle]post:SellerReturnMoney params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            response(YES,json[@"message"]);
        }else{
            response(NO,json[@"message"]);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError);
    }];
}

@end
